<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    {:token()}
    <input type="hidden" name="row[id]" value="{$row.id}">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Class')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-classid" data-rule="required" data-source="allclass/allclass/get_class_list" data-params='' class="form-control selectpage" name="row[classid]" type="text" value="{$row.classid|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sub_title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sub_title" class="form-control" name="row[sub_title]" type="text" value="{$row.sub_title|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">{:__('Cover')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avatar" data-rule="" class="form-control" size="50" name="row[cover]" type="text" value="{$row.cover|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-avatar"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-avatar"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Teachers')}:</label>
        <div class="col-xs-12 col-sm-8">            
            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[teacher_id]">
                {foreach name="teacherList" item="vo"}
                    <option value="{$vo.id}" {in name="vo.id" value="$row.teacher_id"}selected{/in}>{$vo.nickname}</option>
                {/foreach}  
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Number')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-number" data-rule="required" class="form-control" name="row[number]" type="number" value="{$row.number|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Volume')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-volume" data-rule="required" class="form-control" name="row[volume]" type="number" value="{$row.volume|htmlentities}">
        </div>
    </div>
   
    <div class="form-group">
        <label for="c-tags" class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-tags" class="form-control selectpicker" multiple="" name=row[tags][]">
                {foreach name="tags" item="vo"}
                <option value="{$key}" {in name="key" value="$row.tags"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
   
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Introduce')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-introduce" data-rule="required" class="form-control editor" rows="5" name="row[introduce]"  cols="50">{$row.introduce}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-recommend" class="form-control" name="row[sort]" type="number" value="{$row.sort|htmlentities}">
        </div>
    </div>
   
    <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
                {:build_radios('row[status]', ['1'=>__('Publish'), '0'=>__('Unpublish')], $row['status'])}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
